package com.lh.pospi.x_store.adapter;

import android.support.annotation.Nullable;
import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.lh.pospi.x_store.R;
import com.lh.pospi.x_store.modle.GoodsBean;
import com.vondear.rxui.view.RxShoppingView;

import org.greenrobot.greendao.annotation.Id;

import java.util.List;

public class GoodsItemAdapter extends BaseQuickAdapter<GoodsBean,BaseViewHolder> {
    public GoodsItemAdapter(int layoutResId, @Nullable List<GoodsBean> data) {
        super(layoutResId, data);

    }

    @Override
    protected void convert(BaseViewHolder helper, final GoodsBean item) {
        helper.setText(R.id.item_name, item.getName());
        helper.setText(R.id.item_price, "单价：￥"+item.getLsj()+"/"+item.getUnit());
        helper.getView(R.id.iv_select).setVisibility(item.getSelect() ? View.VISIBLE : View.INVISIBLE);
        helper.setText(R.id.item_spec, "规格："+item.getSpec());
        helper.setText(R.id.item_code, "条码：" + item.getBarcode());
        helper.setText(R.id.item_id, "编码："+item.getCode());


    }
}
